﻿using Microsoft.AspNetCore.Mvc.Filters;

namespace _51_AOP.Utility.Filter
{
    // 1.对 context.Result 赋值完，不会执行其他代码直接返回结果的补充



    public class CustomAlwaysRunResultFilterAttribute : Attribute,IAlwaysRunResultFilter
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        public void OnResultExecuted(ResultExecutedContext context)
        {
            Console.WriteLine("CustomAlwaysRunResultFilterAttribute,---end--");
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        public void OnResultExecuting(ResultExecutingContext context)
        {
            Console.WriteLine("CustomAlwaysRunResultFilterAttribute,---begin--");
        }
    }
}
